
const dealTreeAddDisable = (data, currentId) => {
  return data.map(item => {
    // 如果 status === 1，修改 name 并添加 disabled 字段
    if (item.status === 1) {
      item.name = `${item.name}（已失效）`;
      item.disabled = true;
    }

    if (currentId && item.id == currentId) {
      item.name = `${item.name}（当前组织机构）`;
      item.disabled = true;
    }

    // 递归处理 children
    if (item.children && item.children.length > 0) {
      item.children = dealTreeAddDisable(item.children, currentId);
    }

    return item;
  });
}


export {
  dealTreeAddDisable
}